import Vue from 'vue'
import Vuex from 'vuex'
import app from './modules/app'
import user from './modules/user'
import getters from './getters'
import tagsView from './modules/tagsView'
import vueBus from './modules/vueBus'

Vue.use(Vuex)
// 当项目最够大时都放在main.js中很乱，所以把store分到不同的moudle中 每个module拥有自己的state，getters,mutations,actions
const store = new Vuex.Store({
  modules: {
    app,
    user,
    tagsView,
    vueBus
  },
  getters
})
//moudle A的状态 store.state.a 所以这里是store.state.app.XXX
export default store
